<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
</head>

<body>
    <header class="aui-bar aui-bar-nav" style="background-color: #03a9f4;position:fixed;" id="header">
        <a class="aui-pull-left aui-btn" tapmode onclick="closeWin();">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" id="title">
            模具任务单列表
        </div>
    </header>
    <div style="margin-top:25px;"></div>
    <ul class="ui-selectee" id="tbodyHtml">

    </ul>
    <div style="height:60px;"></div>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/doT.min.js"></script>
<script type="text/javascript" src="../script/public.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
    //光标所在id
    var idSelector = "";
    var type = ""; //设备维保类型
    var rsBarcode = ""; //机台号
    var datetime = ""; //计划日期
    apiready = function () {
        rsBarcode = api.pageParam.rsBarcode;
        type = api.pageParam.type;
        datetime = api.pageParam.datetime;
        doSearch()
        
    };

    //查询
    function doSearch() {

        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/searchMoldTaskList";
        var data = {
            values: {
				rsBarcode:rsBarcode,
                datetime: datetime,
                type: type,
                selectAll: 'Y',//查询已处理，已审核
                un: un,
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function (ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");
                if (myobj.code == '0') {
                    var list = eval(myobj.list);
                    setTable(list)

                } else {
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }1
        });
    }

    function setTable(list) {
        var html = "";
        for (var i = 0; i < list.length; i++) {
            html += "<div style='padding-top:4%;'></div>";
            html += "<li class='sortable ui-selectee ui-sortable' >";
            html += "<ul class='aui-list aui-media-list ui-selectee'>";
            html += "<li class='aui-list-item  ui-selectee' style='color: black !important;background-color: #addbef !important;'>";
            html += "<div class='aui-media-list-item-inner ui-selectee ' >";
            html += "<div class='aui-list-item-inner ui-selectee '>";
            html += "<div class='aui-list-item-text ui-selectee' style='height: 25px;'>";
            html += "<div class='aui-list-item-label ui-selectee list-tr-title'>任务号:</div>";
            html += "<div class='aui-list-item-inner ui-selectee'>" + list[i].task_code + "</div>";
            html += "</div>";
            html += "<div class='aui-list-item-text ui-selectee' style='height: 25px;'>";
            html += "<div class='aui-list-item-label ui-selectee list-tr-title'>创建时间:</div>";
            html += "<div class='aui-list-item-inner ui-selectee'>" + list[i].create_date + "</div>";
            html += "</div>";
            html += "<div class='aui-list-item-text ui-selectee' style='height: 25px;'>";
            html += "<div class='aui-list-item-label ui-selectee list-tr-title'>单据状态:</div>";
            html += "<div class='aui-list-item-inner ui-selectee'>" + list[i].taskStateName + "</div>";
            html += "</div>";

            html += "</div>";
            html += "</li>";
            html += "</ul>";
            html += "</li>";
        }
        $api.html($api.byId("tbodyHtml"), html);
    };
    //返回按钮
    function closeWin() {
        api.closeWin({});
    }
</script>

</html>